<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>留言管理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" type="text/css" href="__ADMIN__/layui/css/layui.css" media="all">
  <link rel="stylesheet" type="text/css" href="__ADMIN__/bootstrap/css/bootstrap.css" media="all">
  <link rel="stylesheet" type="text/css" href="__ADMIN__/global.css" media="all">
  <link rel="stylesheet" type="text/css" href="__ADMIN__/css/personal.css" media="all">
</head>
<body>
<section class="layui-larry-box">
  <div class="larry-personal">
    <header class="larry-personal-tit">
      <span>回复留言</span>
    </header><!-- /header -->
    <form class="layui-form" action="/admin/guest/reply" method="post">
      <div class="layui-form-item">
        <label class="layui-form-label">留言内容</label>
        <div class="layui-input-block">
          <span>姓名: </span>{$list.name} <span>邮箱: </span>{$list.email}<br><br>
          <span>留言: </span>{$list.message}<br><br>
          <span>留言时间: </span>{$list.addtime|date="Y-m-d H:i:s",###}<br><br>
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">回复主题</label>
        <div class="layui-input-block">
          <input type="text" name="title" required  lay-verify="required" value="留言回复" autocomplete="off" class="layui-input" style="width:500px;">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">回复</label>
        <div class="layui-input-block" style="width:500px;"> 
          <textarea class="layui-textarea" name="reply" id="LAY_demo2">{$list.reply}</textarea>
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <input type="hidden" name="id" value="{$list.id}" />
          <button class="layui-btn" lay-submit="" lay-filter="demo1">确认回复</button>
          <a href="/admin/guest"><span class="layui-btn layui-btn-primary">返回</span></a>
        </div>
      </div>
    </form>
  </div>
</section>

<script src="__ADMIN__/layui/layui.js" charset="utf-8"></script>
<script>
layui.use('element', function(){
  var $ = layui.jquery
  ,element = layui.element(); //Tab的切换功能，切换事件监听等，需要依赖element模块
});
layui.use('form', function(){
  var form = layui.form();
  });
layui.use('layedit', function(){
  var layedit = layui.layedit
  ,$ = layui.jquery;
  
  //构建一个默认的编辑器
  var index = layedit.build('LAY_demo1');
  
  //编辑器外部操作
  var active = {
    content: function(){
      alert(layedit.getContent(index)); //获取编辑器内容
    }
    ,text: function(){
      alert(layedit.getText(index)); //获取编辑器纯文本内容
    }
    ,selection: function(){
      alert(layedit.getSelection(index));
    }
  };
  
  $('.site-demo-layedit').on('click', function(){
    var type = $(this).data('type');
    active[type] ? active[type].call(this) : '';
  });
  
  //自定义工具栏
  layedit.build('LAY_demo2', {
    tool: ['face', 'link', 'unlink', '|', 'left', 'center', 'right']
    ,height: 100
  })
});
</script>
</body>
</html>